This file will eventually become your project report for P02: Exploratory Data Analysis. Specifically, you will write rmarkdown to report your exploratory data analysis.
Please see Canvas for more details.
# Example 1: Note relative path, which can be read: Up one
# directory(..), down into source (/source), and
# then "source" an R file (data_access.R)
source("../source/data_access.R")
data_access_test()
## [1] "Hello: World!"
# Example 1: This function was "sourced" above
msg <- data_access_test(" Morgan!")
Hello: Morgan! Hope you have a good day!!
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.
The clustered bar chart shows the differences in the distribution of the data. Since the data for the chart contains one categorical and one numerical value, our group used a cluster bar chart to demonstrate the wealth distribution before and during the pandemic in different ethnicity to illustrate inequality. Besides, we decide to integrate interactive elements into the graph for better clarity. For example, when the user selects a section of the chart by left-clicking, it will automatically zoom into that section of the chart. After that, it will automatically re-scale itself by clicking the auto-scale button on the top right corner. The user can gain information when hovering over the bar. According to the chart, White Americans’ wealth has increased steadily before and during the pandemic. However, minorities’ wealth has remained mainly unchanged. Besides, White Americans’ wealth is at least six times more than any minorities’ wealth. Nonetheless, the chart provides evidence that correlates wealth inequality to minorities during the pandemic.